#!D:\python\fp1\Scripts\python.exe
#-*- coding:UTF-8 -*-

# CGI处理模块
import cgi, cgitb 
import codecs, sys ,os

sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer)


def getregisterusers():    
    with open(os.getcwd()+'/data/userlist.txt', 'r') as f:
        return f.readline()

listuser=getregisterusers().split(',')

# 创建 FieldStorage 的实例化
form = cgi.FieldStorage() 

# 获取数据
user_name = form.getvalue('username')

print ("Content-type:text/html")
print ()
if user_name in listuser :
    print ("true")
else :
    print ("false")

